#include "stdafx.h"
#include "VerInfo.h"
using namespace PluginICPopenCVLib;
#include "MxPluginManager\MxPluginManager1.h"
#include "ImageComputePluginLib.h"

#include "PluginICPopenCV.h"
#include "BrightnessImage.h"
#include "ContrastImage.h"
#include "GaussianImage.h"
#include "StretchImage.h"
#include "SnakeImage.h"
#include "MakeEllipsePts.h"
#include "BilateralFilterImage.h"
#include "ErodeImage.h"
#include "DilateImage.h"
#include "GrayscaleImage.h"
#include "ThresholdImage.h"
#include "YCrCbImage.h"
#include "ClosingImage.h"
#include "OpeningImage.h"
#include "MorphologicalGradientImage.h"
#include "DenoiseImage.h"
#include "EqualizeHistogramImage.h"
#include "FloodfillImage.h"
#include "LaplacianSharpImage.h"
#include "SobelSharpImage.h"
#include "PyramidDownImage.h"
#include "PyramidUpImage.h"
#include "RemapImage.h"
#include "RotateImage.h"
#include "TransformImage.h"

ImageComputePluginLib::ImageComputePluginLib(void) :
	_refCnt(0),
	_pluginMngr(nullptr),
	_iImageCompute(nullptr),
	_valid(false)
{
	bool rc = false;

	try
	{
		_pluginMngr = new MxPluginManager(); 
		if (_pluginMngr->RefreshPluginsInRootFolder(SID_ImageProc, true) == true)
		{
			MxPluginLib * ImageComputePlugin = nullptr;
			if ((ImageComputePlugin = _pluginMngr->GetPlugin(PRODID_PluginImageCompute)) == nullptr)
				MX_SETERROR(MX11103, MxError::System,  MxError::Abort,  MxError::VerboseReport, "unable to find PluginImageCompute"); 
			else
			{
				if ((_iImageCompute = static_cast<IImageCompute *>(ImageComputePlugin->CreateClassInstance(IImageComputeIID::Guid()))) == nullptr)
					MX_SETERROR( MX11104, MxError::CodeDefect,  MxError::Abort,  MxError::VerboseReport, "unable to obtain IImageCompute for PluginImageCompute"); 
				else
				{
					if ( _iImageCompute->SetImageComputePluginLib(this) == false) 
						MX_SETERROR( MX11105, MxError::CodeDefect,  MxError::Abort,  MxError::VerboseReport, "SetImagePluginSpec() failed"); 
					else
					{
						if  (SetFunctionDefs(_iImageCompute) == false)
							MX_SETERROR( MX11106, MxError::CodeDefect,  MxError::Abort,  MxError::VerboseReport, "SetFunctionDefs() failed"); 
						else
						{
							if ( (Validate() == false) || (IsValid() == false))
								MX_SETERROR( MX11107, MxError::CodeDefect,  MxError::Abort,  MxError::VerboseReport, "Validate() failed"); 
							else
							{
								rc = true;
							}
						}
					}
				}
			}
		}
	}
	catch(std::exception const& e)
	{
		MX_SETERROR(MX11108, MxError::CodeDefect,  MxError::Abort,  MxError::QuietReport, "Unexpected exception: %s", e.what()); 
	}
}


ImageComputePluginLib::~ImageComputePluginLib(void)
{
	if (_iImageCompute != nullptr)
		_iImageCompute->DestroyPtr();
	_iImageCompute = nullptr;

	if (_pluginMngr != nullptr)
		delete _pluginMngr; 
	_pluginMngr = nullptr;
}

bool  MXSTDMETHOD ImageComputePluginLib::Validate()
{
	bool rc  = false;

	if ((_iImageCompute->Validate() == false) || (_iImageCompute->IsValid() == false))
		MX_SETERROR(MX11259, MxError::System, MxError::Abort, MxError::VerboseReport, "_iImageCompute->Validate() failed");
	else
	{
		if (_iImageCompute->GetFnClassCount() != 1)
			MX_SETERROR(MX11260, MxError::System, MxError::Abort, MxError::VerboseReport, "_iImageCompute->GetFnClassCount() != 1");
		else if (_iImageCompute->IsFnClassValid("Common", 25, IDB_FNCLASS_COMMON) == false)	//check the bitmap is 25x20 = 500 pixels x 20 pixels
			MX_SETERROR(MX11261, MxError::System, MxError::Abort, MxError::VerboseReport, "_iImageCompute->IsFnClassValid(conversions) failed");
		else
		{
			_valid = true;
			rc = _valid;
		}
	}
	return rc;
}

IImageCompute*	MXSTDMETHOD ImageComputePluginLib::GetIImageCompute()
{ 
	IImageCompute*	rc = nullptr;

	if ((_iImageCompute == nullptr) || (_iImageCompute->IsValid() == false))
		MX_SETERROR(MX11110, MxError::CodeDefect,  MxError::Abort,  MxError::QuietReport, "_iImageCompute is null or invalid"); 
	else
	{
		rc = _iImageCompute;
		rc->DuplicatePtr();
	}
	return rc; 
}

bool		MXSTDMETHOD ImageComputePluginLib::SetFunctionDefs(IImageCompute *iImageCompute)
{
	bool rc  = false;

	if (iImageCompute == nullptr)
		MX_SETERROR(MX11111, MxError::InvalidParams,  MxError::Abort,  MxError::VerboseReport, "iImageCompute is null");
	else
	{
		bool done = true;
		if (done == true)
		{
			done = false;
			GUID FnBrightness = MxGUID::ConvertFromString("{E7104626-038F-4BB6-A7E3-9DB823673436}");
			if ((_iImageCompute->CreateFunctionDef(FnBrightness, "BrightnessImg", "Brighten the image", "Common", "Brighten", IDB_FNCLASS_COMMON, 0, "http://www.imageqc.com/plugins/suppport/E7104626-038F-4BB6-A7E3-9DB823673436", dynamic_cast<IImageComputeFnCall *>(new BrightnessImage())) == false)
				||  (_iImageCompute->AddFunctionParamDef(FnBrightness, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				||  (_iImageCompute->AddFunctionParamDef(FnBrightness, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				||  (_iImageCompute->AddFunctionParamDef(FnBrightness, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				||  (_iImageCompute->AddFunctionParamDef(FnBrightness, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
                ||	(_iImageCompute->AddFunctionParamDef(  FnBrightness, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				||	(_iImageCompute->AddFunctionParamDef(  FnBrightness, "Beta", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "Brightness", "Brightness : negative or positive bias value in typical range -1000.0 to +1000.0 (0.0 has no effect)") == false))
					MX_SETERROR( MX11171, MxError::System,  MxError::Abort,  MxError::VerboseReport, "unable to add Fn BrightenImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if((iFn = _iImageCompute->GetIImageComputeFn( FnBrightness)) == nullptr)
					MX_SETERROR(MX11172, MxError::System,  MxError::Abort,  MxError::VerboseReport, "cannot get IImageComputeFn for BrightenImg");
				else
				{
					if (   (iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamDouble("Beta", 50.0) == false))
						MX_SETERROR(MX11173, MxError::System,  MxError::Abort,  MxError::VerboseReport, "failed to set params for BrightenImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnContrast = MxGUID::ConvertFromString("{30F9C62C-EDBF-4B00-8973-648490C13218}");
			if ((_iImageCompute->CreateFunctionDef(FnContrast, "ContrastImg", "Contrast enhance the image", "Common", "Contrast", IDB_FNCLASS_COMMON, 1, "http://www.imageqc.com/plugins/suppport/30F9C62C-EDBF-4B00-8973-648490C13218", dynamic_cast<IImageComputeFnCall *>(new ContrastImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnContrast, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnContrast, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnContrast, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnContrast, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnContrast, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(FnContrast, "Alpha", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "1.0", "Contrast", "Contrast: positive gain value in typical range 0.1 to 500.0 (1.0 has no effect)", "0.0") == false))
					MX_SETERROR( MX11162, MxError::System,  MxError::Abort,  MxError::VerboseReport, "unable to add Fn ContrastImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if((iFn = _iImageCompute->GetIImageComputeFn( FnContrast)) == nullptr)
					MX_SETERROR( MX11163, MxError::System,  MxError::Abort,  MxError::VerboseReport, "cannot get IImageComputeFn for ContrastImg");
				else
				{
					if (   (iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamDouble("Alpha", 1.5) == false))
						MX_SETERROR( MX11164, MxError::System,  MxError::Abort,  MxError::VerboseReport, "failed to set params for ContrastImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnGaussian = MxGUID::ConvertFromString("{4CCF13FA-B96F-4B79-9C7B-464A40722BEC}");
			if ((_iImageCompute->CreateFunctionDef(FnGaussian, "GaussianImg", "Smooth the image using Gaussian", "Common", "Gaussian", IDB_FNCLASS_COMMON, 2, "http://www.imageqc.com/plugins/suppport/4CCF13FA-B96F-4B79-9C7B-464A40722BEC", dynamic_cast<IImageComputeFnCall *>(new GaussianImage())) == false)
				||  (_iImageCompute->AddFunctionParamDef(FnGaussian, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				 || (_iImageCompute->AddFunctionParamDef(FnGaussian, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				 || (_iImageCompute->AddFunctionParamDef(FnGaussian, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				 || (_iImageCompute->AddFunctionParamDef(FnGaussian, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				 || (_iImageCompute->AddFunctionParamDef(FnGaussian, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(  FnGaussian, "KernelHt", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "3", "Kernel Height", "Height of kernel used for smoothing - must be positive and odd (SigmaX used if 0)", "0") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(  FnGaussian, "KernelWd", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "3", "Kernel Width", "Width of kernel used for smoothing - must be positive and odd (SigmaY used if 0)", "0") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(  FnGaussian, "SigmaX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "Sigma X", "kernel standard deviation in X direction (KernelX,Y used if 0.0)", "0.0") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(  FnGaussian, "SigmaY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "Sigma Y", "kernel standard deviation in Y direction (Sigma X used as value if 0.0)", "0.0") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(  FnGaussian, "Border", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "Border Type", "0=BORDER_DEFAULT, 1=BORDER_REPLICATE, 2=BORDER_REFLECT, 3=BORDER_REFLECT_101, 4=BORDER_WRAP, 5=BORDER_CONSTANT", "0", "5") == false))
					MX_SETERROR( MX11162, MxError::System,  MxError::Abort,  MxError::VerboseReport, "unable to add Fn GaussianImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if((iFn = _iImageCompute->GetIImageComputeFn( FnGaussian)) == nullptr)
					MX_SETERROR( MX11163, MxError::System,  MxError::Abort,  MxError::VerboseReport, "cannot get IImageComputeFn for GaussianImg");
				else
				{
					if (   (iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("KernelHt", 3) == false)
						|| (iFn->SetParamInt("KernelWd", 3) == false)
						|| (iFn->SetParamDouble("SigmaX", 0.0) == false)
						|| (iFn->SetParamDouble("SigmaY", 0.0) == false)
						|| (iFn->SetParamInt("Border", 0) == false))
						MX_SETERROR( MX11164, MxError::System,  MxError::Abort,  MxError::VerboseReport, "failed to set params for GaussianImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnStretch = MxGUID::ConvertFromString("{E9C2D74B-162B-45D6-AF42-807611AF214B}");
			if ((_iImageCompute->CreateFunctionDef(FnStretch, "StretchImg", "Stretch the image ignoring bins with less than ValMin pixels", "Common", "Stretch", IDB_FNCLASS_COMMON, 3, "http://www.imageqc.com/plugins/suppport/E9C2D74B-162B-45D6-AF42-807611AF214B", dynamic_cast<IImageComputeFnCall *>(new StretchImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnStretch, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnStretch, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnStretch, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnStretch, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnStretch, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				 ||	(_iImageCompute->AddFunctionParamDef(  FnStretch, "ValMin", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ValMin", "ignore bins with less than ValMin pixels", "0") == false))
					MX_SETERROR(  MX11140, MxError::System,  MxError::Abort,  MxError::VerboseReport, "unable to add Fn StretchImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if((iFn = _iImageCompute->GetIImageComputeFn( FnStretch)) == nullptr)
					MX_SETERROR(  MX11141, MxError::System,  MxError::Abort,  MxError::VerboseReport, "cannot get IImageComputeFn for StretchImg");
				else
				{
					if (   (iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("ValMin", 3000) == false))
						MX_SETERROR(  MX11142, MxError::System,  MxError::Abort,  MxError::VerboseReport, "failed to set params for StretchImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnMakeEllipsePts = MxGUID::ConvertFromString("{6A022824-68BC-44B1-A0D5-D2411827DC80}");
			if ((_iImageCompute->CreateFunctionDef(FnMakeEllipsePts, "MakeEllipsePts", "Create an array of image coordinate points for ellipse from major and minor axis pts", "Common", "MakEllipse", IDB_FNCLASS_COMMON, 4, "http://www.imageqc.com/plugins/suppport/6A022824-68BC-44B1-A0D5-D2411827DC80", dynamic_cast<IImageComputeFnCall *>(new MakeEllipsePts())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "MajorMinorAxis", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "ArrayInts:0;", "MajorMinorAxisPts", "image coordinates of pixel points in ellipse major and minor axis as ArrayInts:MajB.x,MajB.y;Majb.x,Majb.y;MinB.x,MinB.y;Minb.x,Minb.y; (if minor axis missing, duplicate major)") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "Delta", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "24", "Delta", "degrees between points created on ellipse boundary (min 5)", "5") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMakeEllipsePts, "BoundaryPts", IImageComputeFnDef::Direction::Output, IImageComputeFnDef::ParamType::String, "ArrayInts:0;", "Result Pts", "image coordinates of pixel points in ellipse boundary as ArrayInts:1.x,1.y;2.x,2.y;n.x,n.y;n.x,n.y;") == false))
				MX_SETERROR(MX11213, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn MakeEllipsePts");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnMakeEllipsePts)) == nullptr)
					MX_SETERROR(MX11214, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for StretchImg");
				else
				{
					if (   (iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamStr("MajorMinorAxis", "ArrayInts:10,10;20,10;15,5;15,15;") == false)
						|| (iFn->SetParamInt("Delta", 10) == false)
						|| (iFn->SetParamStr("BoundaryPts", "ArrayInts:[empty]") == false))
						MX_SETERROR(MX11215, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for MakeEllipsePts sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnSnake = MxGUID::ConvertFromString("{66D56DA2-0DD0-4617-9036-61FBC78BF0A0}");
			if ((_iImageCompute->CreateFunctionDef(FnSnake, "SnakeImg", "Find boundary of the image using Snake Algorithm", "Common", "Snake", IDB_FNCLASS_COMMON, 5, "http://www.imageqc.com/plugins/suppport/66D56DA2-0DD0-4617-9036-61FBC78BF0A0", dynamic_cast<IImageComputeFnCall *>(new SnakeImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "Alpha", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.4", "Alpha", "Snake Alpha parameter") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "Beta", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.2", "Beta", "Snake Beta parameter") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "Gamma", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "1.0", "Gamma", "Snake Gamma parameter") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "NeighborHt", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "3", "Neighbor Ht", "Neighborhood search width", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "NeighborWd", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "3", "Neighbor Wd", "Neighborhood search height", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "MaxIter", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "1000", "Max Iter", "Maximum number of iterations", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "Epsilon", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.1", "Epsilon", "Snake Epsilon parameter") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "InitPts", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "ArrayInts:0;", "Initial Pts", "Initial points for Snake in ArrayInts format") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "Gradient", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "Gradient", "Snake Gradient parameter") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "ResPts", IImageComputeFnDef::Direction::Output, IImageComputeFnDef::ParamType::String, "ArrayInts:0;", "Result Pts", "image coordinates of pixel points in snake boundary as ArrayInts:1.x;1.y;2.x;2.y;n.x;n.y;n.x;n.y;") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "RotRect", IImageComputeFnDef::Direction::Output, IImageComputeFnDef::ParamType::String, "ArrayInts:0;", "RotRect", "Rotated rectangle marking boundary of pixel points as ArrayInts:Centre.x,Centre.y;Wd,Ht;Angle;") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSnake, "Score", IImageComputeFnDef::Direction::Output, IImageComputeFnDef::ParamType::Double, "-1.0", "Score", "Score is match of Snake result boundary against initial points") == false)	)
					MX_SETERROR(  MX11143, MxError::System,  MxError::Abort,  MxError::VerboseReport, "unable to add Fn SnakeImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnSnake)) == nullptr)
					MX_SETERROR(  MX11144, MxError::System,  MxError::Abort,  MxError::VerboseReport, "cannot get IImageComputeFn for SnakeImg");
				else
				{
					if (    (iFn->SetParamBool("StopProc", false) == false)
						 || (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						 || (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						 || (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						 || (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						 || (iFn->SetParamDouble( "Alpha", 0.4) == false)
						 || (iFn->SetParamDouble("Beta", 0.2 ) == false)			
						 || (iFn->SetParamDouble("Gamma", 1.0) == false)				
						 || (iFn->SetParamInt("NeighborHt", 3) == false)	
						 || (iFn->SetParamInt("NeighborWd", 3) == false)	
						 || (iFn->SetParamInt("MaxIter",  1000) == false)	
						 || (iFn->SetParamDouble("Epsilon",  0.1) == false)	
						 || (iFn->SetParamStr("InitPts", "ArrayInts:20;20;40;10;40;40;60;20;") == false)
						 || (iFn->SetParamInt("Gradient",  0) == false)
						 || (iFn->SetParamStr("ResPts", "ArrayInts:20;20;40;10;40;40;60;20;") == false)
						 || (iFn->SetParamStr("RotRect", "ArrayInts:250;120;80;40;30;") == false)
						 || (iFn->SetParamDouble("Score",  -1.0) == false))
						MX_SETERROR(  MX11145, MxError::System,  MxError::Abort,  MxError::VerboseReport, "failed to set params for SnakeImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnBilateralFilter = MxGUID::ConvertFromString("{C245540B-3B20-4A4E-8AE4-5DF17A09BA14}");
			if ((_iImageCompute->CreateFunctionDef(FnBilateralFilter, "BilateralFilterImg", "Smoothen the image by removing unwanted noise while keeping the edges sharp", "Common", "BilateralFilter", IDB_FNCLASS_COMMON, 6, "http://www.imageqc.com/plugins/suppport/C245540B-3B20-4A4E-8AE4-5DF17A09BA14", dynamic_cast<IImageComputeFnCall *>(new BilateralFilterImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "Diameter", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "15", "Diameter", "Diameter: diameter of neighbouring pixel typical range -20 to 20 (in case of negative sigma values will be used to calculate)", "-20") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "SigmaColor", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "80.0", "SigmaColor", "SigmaColor: filter sigma in color space in typical range 10.0 to 150.0 (10.0 will not have much effect)", "10.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnBilateralFilter, "SigmaSpace", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "80.0", "SigmaSpace", "SigmaSpace: filter sigma in coordinate space in typical range 10.0 to 150.0 (10.0 will not have much effect)", "10.0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn BilateralFilterImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnBilateralFilter)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for BilateralFilterImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("Diameter", 15) == false)
						|| (iFn->SetParamDouble("SigmaColor", 80.0) == false)
						|| (iFn->SetParamDouble("SigmaSpace", 80.0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for BilateralFilterImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnErodeImage = MxGUID::ConvertFromString("{B4EE518D-BFE4-44FF-B4B5-88A776A29861}");
			if ((_iImageCompute->CreateFunctionDef(FnErodeImage, "ErodeImg", "Morphological operation of erosion of image", "Common", "Erode", IDB_FNCLASS_COMMON, 7, "http://www.imageqc.com/plugins/suppport/B4EE518D-BFE4-44FF-B4B5-88A776A29861", dynamic_cast<IImageComputeFnCall *>(new ErodeImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "ErosionElement", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionElement", "ErosionElement: Erosion element are in typical range 0 to 2", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnErodeImage, "ErosionSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionSize", "ErosionSize: Erosion size are in typical range of 0 to 21", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn BilateralFilterImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnErodeImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for BilateralFilterImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("ErosionElement", 0) == false)
						|| (iFn->SetParamInt("ErosionSize", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for ErodeImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnDilateImage = MxGUID::ConvertFromString("{D78F924E-FD0E-4233-B1DA-F04A1E8261D1}");
			if ((_iImageCompute->CreateFunctionDef(FnDilateImage, "DilateImg", "Morphological operation of dialtion of image", "Common", "Dilate", IDB_FNCLASS_COMMON, 8, "http://www.imageqc.com/plugins/suppport/D78F924E-FD0E-4233-B1DA-F04A1E8261D1", dynamic_cast<IImageComputeFnCall *>(new DilateImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "DilationElement", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "DilationElement", "DilationElement: Dilation element are in typical range 0 to 2", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDilateImage, "DilationSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "DilationSize", "DilationSize: Dilation size are in typical range of 0 to 21", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn DilateImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnDilateImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for DilateImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("DilationElement", 0) == false)
						|| (iFn->SetParamInt("DilationSize", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for DilateImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnGrayscaleImage = MxGUID::ConvertFromString("{5562F011-E582-4AE2-9B60-F236E74D2054}");
			if ((_iImageCompute->CreateFunctionDef(FnGrayscaleImage, "GrayscaleImg", "Grayscale image conversion", "Common", "Grayscale", IDB_FNCLASS_COMMON, 9, "http://www.imageqc.com/plugins/suppport/5562F011-E582-4AE2-9B60-F236E74D2054", dynamic_cast<IImageComputeFnCall *>(new GrayscaleImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnGrayscaleImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnGrayscaleImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnGrayscaleImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnGrayscaleImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnGrayscaleImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn GrayscaleImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnGrayscaleImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for GrayscaleImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for GrayscaleImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnYCrCbImage = MxGUID::ConvertFromString("{E2C440F4-A4F7-48C4-A0A2-6B48A6C460E8}");
			if ((_iImageCompute->CreateFunctionDef(FnYCrCbImage, "YCrCbImg", "YCrCb image conversion", "Common", "YCrCb", IDB_FNCLASS_COMMON, 10, "http://www.imageqc.com/plugins/suppport/E2C440F4-A4F7-48C4-A0A2-6B48A6C460E8", dynamic_cast<IImageComputeFnCall *>(new YCrCbImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnYCrCbImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnYCrCbImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnYCrCbImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnYCrCbImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnYCrCbImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn YCrCbImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnYCrCbImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for YCrCbImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for YCrCbImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnThresholdImage = MxGUID::ConvertFromString("{730BCB32-4021-45FE-9420-CBFBF91CA328}");
			if ((_iImageCompute->CreateFunctionDef(FnThresholdImage, "ThresholdImg", "Basic thresholding operation", "Common", "Threshold", IDB_FNCLASS_COMMON, 11, "http://www.imageqc.com/plugins/suppport/0868C60F-ECB7-4017-B333-4CDADD7C5D60", dynamic_cast<IImageComputeFnCall *>(new ThresholdImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "ThresholdValue", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ThresholdValue", "ThresholdValue: Threshold value are in typical range 0 to 255", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnThresholdImage, "ThresholdType", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ThresholdType", "ThresholdType: Threshold type are in typical range 0 to 4", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn ThresholdImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnThresholdImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for ThresholdImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("ThresholdValue", 0) == false)
						|| (iFn->SetParamInt("ThresholdType", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for ThresholdImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnClosingImage = MxGUID::ConvertFromString("{D1B42775-7D77-425B-884C-834A4BB415F9}");
			if ((_iImageCompute->CreateFunctionDef(FnClosingImage, "ClosingImg", "Closing morphology operation.Useful to remove dark regions", "Common", "Closing", IDB_FNCLASS_COMMON, 12, "http://www.imageqc.com/plugins/suppport/D1B42775-7D77-425B-884C-834A4BB415F9", dynamic_cast<IImageComputeFnCall *>(new ClosingImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "ErosionElement", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionElement", "ErosionElement: Erosion element are in typical range 0 to 2", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnClosingImage, "ErosionSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionSize", "ErosionSize: Erosion size are in typical range of 0 to 21", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn ClosingImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnClosingImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for ClosingImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("ErosionElement", 0) == false)
						|| (iFn->SetParamInt("ErosionSize", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for ClosingImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnOpeningImage = MxGUID::ConvertFromString("{32A5D5C4-B12C-49FD-A2E2-51A2F8523C31}");
			if ((_iImageCompute->CreateFunctionDef(FnOpeningImage, "OpeningImg", "Opening morphology operation useful to remove small objects", "Common", "Opening", IDB_FNCLASS_COMMON, 13, "http://www.imageqc.com/plugins/suppport/32A5D5C4-B12C-49FD-A2E2-51A2F8523C31", dynamic_cast<IImageComputeFnCall *>(new OpeningImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "ErosionElement", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionElement", "ErosionElement: Erosion element are in typical range 0 to 2", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnOpeningImage, "ErosionSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionSize", "ErosionSize: Erosion size are in typical range of 0 to 21", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn OpeningImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnOpeningImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for OpeningImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("ErosionElement", 0) == false)
						|| (iFn->SetParamInt("ErosionSize", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for OpeningImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnMorphologicalGradientImage = MxGUID::ConvertFromString("{E9581591-A000-4810-817F-DF79D5985038}");
			if ((_iImageCompute->CreateFunctionDef(FnMorphologicalGradientImage, "MorphologicalGradientImg", "Morphological Gradient morphology operation useful for finding the outline of an object", "Common", "MorphologicalGradient", IDB_FNCLASS_COMMON, 14, "http://www.imageqc.com/plugins/suppport/E9581591-A000-4810-817F-DF79D5985038", dynamic_cast<IImageComputeFnCall *>(new MorphologicalGradientImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "ErosionElement", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionElement", "ErosionElement: Erosion element are in typical range 0 to 2", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnMorphologicalGradientImage, "ErosionSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "ErosionSize", "ErosionSize: Erosion size are in typical range of 0 to 21", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn MorphologicalGradientImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnMorphologicalGradientImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for MorphologicalGradientImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("ErosionElement", 0) == false)
						|| (iFn->SetParamInt("ErosionSize", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for MorphologicalGradientImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnDenoiseImage = MxGUID::ConvertFromString("{99EED209-7981-43C7-A606-1F82DE4BCD09}");
			if ((_iImageCompute->CreateFunctionDef(FnDenoiseImage, "DenoiseImg", "Perform image denoising using Non-local Means Denoising algorithm", "Common", "Denoise", IDB_FNCLASS_COMMON, 15, "http://www.imageqc.com/plugins/suppport/99EED209-7981-43C7-A606-1F82DE4BCD09", dynamic_cast<IImageComputeFnCall *>(new DenoiseImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "H", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "7.0", "H", "H: Parameter regulating filter strength for luminance component", "3.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "HColor", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "7.0", "HColor", "HColor: The same as h but for color components", "3.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "TemplateWindowSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "7", "TemplateWindowSize", "TemplateWindowSize: Size in pixels of the template patch that is used to compute weights. Should be odd", "3") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnDenoiseImage, "SearchWindowSize", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "21", "SearchWindowSize", "SearchWindowSize:  Size in pixels of the window that is used to compute weighted average for given pixel. Should be odd", "3") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn DenoiseImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnDenoiseImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for DenoiseImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamDouble("H", 7.0) == false)
						|| (iFn->SetParamDouble("HColor", 7.0) == false)
						|| (iFn->SetParamInt("TemplateWindowSize", 7) == false)
						|| (iFn->SetParamInt("SearchWindowSize", 21) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for DenoiseImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnEqualizeHistogramImage = MxGUID::ConvertFromString("{AD685E85-5C74-4153-9133-7CA698D95570}");
			if ((_iImageCompute->CreateFunctionDef(FnEqualizeHistogramImage, "EqualizeHistogramImg", "Distribute intensities uniformly so the intensity values are spreaded over the whole range", "Common", "EqualizeHistogram", IDB_FNCLASS_COMMON, 16, "http://www.imageqc.com/plugins/suppport/AD685E85-5C74-4153-9133-7CA698D95570", dynamic_cast<IImageComputeFnCall *>(new EqualizeHistogramImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnEqualizeHistogramImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnEqualizeHistogramImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnEqualizeHistogramImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnEqualizeHistogramImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnEqualizeHistogramImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn EqualizeHistogramImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnEqualizeHistogramImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for EqualizeHistogramImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for EqualizeHistogramImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnFloodfillImage = MxGUID::ConvertFromString("{18F4AC4F-B042-45F1-A67E-0644BF301A48}");
			if ((_iImageCompute->CreateFunctionDef(FnFloodfillImage, "FloodfillImg", "Fills a connected component with the given color", "Common", "Floodfill", IDB_FNCLASS_COMMON, 17, "http://www.imageqc.com/plugins/suppport/18F4AC4F-B042-45F1-A67E-0644BF301A48", dynamic_cast<IImageComputeFnCall *>(new FloodfillImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "SeedPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "SeedPointX", "SeedPointX: X coordinate of seed point in range of 0 to image width", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "SeedPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "SeedPointY", "SeedPointY: Y coordinate of seed point in range of 0 to image height", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "NewColorRed", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "255", "NewColorRed", "NewColorRed: Red component of fill color in range of 0 to 255", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "NewColorGreen", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "255", "NewColorGreen", "NewColorGreen:  Green component of fill color in range of 0 to 255", "0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnFloodfillImage, "NewColorBlue", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "255", "NewColorBlue", "NewColorBlue:  Blue component of fill color in range of 0 to 255", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn FloodfillImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnFloodfillImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for FloodfillImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("SeedPointX", 0) == false)
						|| (iFn->SetParamInt("SeedPointY", 0) == false)
						|| (iFn->SetParamInt("NewColorRed", 255) == false)
						|| (iFn->SetParamInt("NewColorGreen", 255) == false)
						|| (iFn->SetParamInt("NewColorBlue", 255) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for FloodfillImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnLaplacianSharpImage = MxGUID::ConvertFromString("{B29B2979-44B4-4095-BA2F-557BEFAD59AB}");
			if ((_iImageCompute->CreateFunctionDef(FnLaplacianSharpImage, "LaplacianSharpImg", "Sharpen image using the laplacian operator", "Common", "LaplacianSharp", IDB_FNCLASS_COMMON, 18, "http://www.imageqc.com/plugins/suppport/B29B2979-44B4-4095-BA2F-557BEFAD59AB", dynamic_cast<IImageComputeFnCall *>(new LaplacianSharpImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnLaplacianSharpImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnLaplacianSharpImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnLaplacianSharpImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnLaplacianSharpImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnLaplacianSharpImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn LaplacianSharpImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnLaplacianSharpImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for LaplacianSharpImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for LaplacianSharpImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnSobelSharpImage = MxGUID::ConvertFromString("{7F2C1B87-9903-49B0-863C-ED5D325F40E5}");
			if ((_iImageCompute->CreateFunctionDef(FnSobelSharpImage, "SobelSharpImg", "Sharpen image using the sobel operator", "Common", "SobelSharp", IDB_FNCLASS_COMMON, 19, "http://www.imageqc.com/plugins/suppport/7F2C1B87-9903-49B0-863C-ED5D325F40E5", dynamic_cast<IImageComputeFnCall *>(new SobelSharpImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSobelSharpImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSobelSharpImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSobelSharpImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSobelSharpImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSobelSharpImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnSobelSharpImage, "Direction", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "0", "Direction", "Direction: X or Y direction of sobel operator. Values are 0 or 1", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn SobelSharpImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnSobelSharpImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for SobelSharpImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("Direction", 0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for SobelSharpImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnPyramidUpImage = MxGUID::ConvertFromString("{9EDA536B-A6E6-4101-9EAD-D239A9123F45}");
			if ((_iImageCompute->CreateFunctionDef(FnPyramidUpImage, "PyramidUpImg", "Upsamples image to double of its size", "Common", "PyramidUp", IDB_FNCLASS_COMMON, 20, "http://www.imageqc.com/plugins/suppport/9EDA536B-A6E6-4101-9EAD-D239A9123F45", dynamic_cast<IImageComputeFnCall *>(new PyramidUpImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidUpImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidUpImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidUpImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidUpImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidUpImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn PyramidUpImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnPyramidUpImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for PyramidUpImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for PyramidUpImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnPyramidDownImage = MxGUID::ConvertFromString("{448F8BFD-CA35-445C-87A0-F9C90D83165B}");
			if ((_iImageCompute->CreateFunctionDef(FnPyramidDownImage, "PyramidDownImg", "Downsamples image to half of its size", "Common", "PyramidDown", IDB_FNCLASS_COMMON, 21, "http://www.imageqc.com/plugins/suppport/448F8BFD-CA35-445C-87A0-F9C90D83165B", dynamic_cast<IImageComputeFnCall *>(new PyramidDownImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidDownImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidDownImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidDownImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidDownImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnPyramidDownImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn PyramidDownImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnPyramidDownImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for PyramidDownImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for PyramidDownImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnRemapImage = MxGUID::ConvertFromString("{CBE5BD11-C293-4ADF-A482-5D02D01AC818}");
			if ((_iImageCompute->CreateFunctionDef(FnRemapImage, "RemapImg", "Image remapping by repositioning pixels", "Common", "Remap", IDB_FNCLASS_COMMON, 22, "http://www.imageqc.com/plugins/suppport/CBE5BD11-C293-4ADF-A482-5D02D01AC818", dynamic_cast<IImageComputeFnCall *>(new RemapImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRemapImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRemapImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRemapImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRemapImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRemapImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRemapImage, "Type", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Integer, "1", "Type", "Type: Type of remap operations in range of 0 to 3", "0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn RemapImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnRemapImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for RemapImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamInt("Type", 1) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for RemapImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnRotateImage = MxGUID::ConvertFromString("{660C03EF-5F82-4630-A3BE-F78A329F4653}");
			if ((_iImageCompute->CreateFunctionDef(FnRotateImage, "RotateImg", "Image rotation around center of image", "Common", "Rotate", IDB_FNCLASS_COMMON, 23, "http://www.imageqc.com/plugins/suppport/660C03EF-5F82-4630-A3BE-F78A329F4653", dynamic_cast<IImageComputeFnCall *>(new RotateImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRotateImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRotateImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRotateImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRotateImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRotateImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnRotateImage, "Angle", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "90.0", "Angle", "Angle: Angle of rotation in degrees in range of 0 to 360", "0.0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn RotateImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnRotateImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for RotateImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamDouble("Angle", 90.0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for RotateImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			done = false;
			GUID FnTransformImage = MxGUID::ConvertFromString("{B6627EBE-A40E-48F2-BB3B-EE49856C035D}");
			if ((_iImageCompute->CreateFunctionDef(FnTransformImage, "TransformImg", "Affine transformation of image", "Common", "Transform", IDB_FNCLASS_COMMON, 24, "http://www.imageqc.com/plugins/suppport/B6627EBE-A40E-48F2-BB3B-EE49856C035D", dynamic_cast<IImageComputeFnCall *>(new TransformImage())) == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "StopProc", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::Bool, "no", "Stop", "Do not process this step or any further steps") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "RootFolder", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "Root folder", "folder for project root") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "IJC", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJC id", "GUID for job collection") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "IJF", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::String, "-", "IJF id", "GUID for job file") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "ImageRef", IImageComputeFnDef::Direction::IO, IImageComputeFnDef::ParamType::String, "-", "ImageRef", "name of input image in ImageFolder without filetype") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "SrcFirstPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "SrcFirstPointX", "SrcFirstPointX: X coordinate of first point of source image in range of 0 to image width", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "SrcFirstPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "SrcFirstPointY", "SrcFirstPointY: Y coordinate of first point of source image in range of 0 to image height", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "SrcSecondPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "100.0", "SrcSecondPointX", "SrcSecondPointX: X coordinate of second point of source image in range of 0 to image width", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "SrcSecondPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "SrcSecondPointY", "SrcSecondPointY: Y coordinate of second point of source image in range of 0 to image height", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "SrcThirdPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "SrcThirdPointX", "SrcThirdPointX: X coordinate of third point of source image in range of 0 to image width", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "SrcThirdPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "100.0", "SrcThirdPointY", "SrcThirdPointY: Y coordinate of third point of source image in range of 0 to image height", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "DstFirstPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "200.0", "DstFirstPointX", "DstFirstPointX: X coordinate of first point of destination image in range of 0 to image width", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "DstFirstPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "200.0", "DstFirstPointY", "DstFirstPointY: Y coordinate of first point of destination image in range of 0 to image height", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "DstSecondPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "300.0", "DstSecondPointX", "DstSecondPointX: X coordinate of second point of destination image in range of 0 to image width", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "DstSecondPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "DstSecondPointY", "DstSecondPointY: Y coordinate of second point of destination image in range of 0 to image height", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "DstThirdPointX", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "0.0", "DstThirdPointX", "DstThirdPointX: X coordinate of third point of destination image in range of 0 to image width", "0.0") == false)
				|| (_iImageCompute->AddFunctionParamDef(FnTransformImage, "DstThirdPointY", IImageComputeFnDef::Direction::Input, IImageComputeFnDef::ParamType::Double, "300.0", "DstThirdPointY", "DstThirdPointY: Y coordinate of third point of destination image in range of 0 to image height", "0.0") == false))
				MX_SETERROR(MX11162, MxError::System, MxError::Abort, MxError::VerboseReport, "unable to add Fn TransformImg");
			else
			{
				IImageComputeFn *iFn = nullptr;
				if ((iFn = _iImageCompute->GetIImageComputeFn(FnTransformImage)) == nullptr)
					MX_SETERROR(MX11163, MxError::System, MxError::Abort, MxError::VerboseReport, "cannot get IImageComputeFn for TransformImg");
				else
				{
					if ((iFn->SetParamBool("StopProc", false) == false)
						|| (iFn->SetParamStr("RootFolder", "C:\\Wills\\UnitTest\\D68A6A73-93FB-430D-A661-FEBF64EAE60F") == false)
						|| (iFn->SetParamStr("IJC", "9A474437-2651-422C-A226-D0248EED7308") == false)
						|| (iFn->SetParamStr("IJF", "61FB5F0C-067E-43ED-A957-8CF242D42BCF") == false)
						|| (iFn->SetParamStr("ImageRef", "1.2.826.999999.1.9999.1.2008070708343464.1.1.0") == false)
						|| (iFn->SetParamDouble("SrcFirstPointX", 0.0) == false)
						|| (iFn->SetParamDouble("SrcFirstPointY", 0.0) == false)
						|| (iFn->SetParamDouble("SrcSecondPointX", 100.0) == false)
						|| (iFn->SetParamDouble("SrcSecondPointY", 0.0) == false)
						|| (iFn->SetParamDouble("SrcThirdPointX", 0.0) == false)
						|| (iFn->SetParamDouble("SrcThirdPointY", 100.0) == false)
						|| (iFn->SetParamDouble("DstFirstPointX", 200.0) == false)
						|| (iFn->SetParamDouble("DstFirstPointY", 200.0) == false)
						|| (iFn->SetParamDouble("DstSecondPointX", 300.0) == false)
						|| (iFn->SetParamDouble("DstSecondPointY", 0.0) == false)
						|| (iFn->SetParamDouble("DstThirdPointX", 0.0) == false)
						|| (iFn->SetParamDouble("DstThirdPointY", 300.0) == false))
						MX_SETERROR(MX11164, MxError::System, MxError::Abort, MxError::VerboseReport, "failed to set params for TransformImg sample invocation");
					else
					{
						done = true;
					}
					iFn->DestroyPtr();
				}
			}
		}
		if (done == true)
		{
			rc = true;
		}
	}
	return rc;
}

long		MXSTDMETHOD ImageComputePluginLib::DestroyPtr(void)
{
	long cnt = InterlockedDecrement(&_refCnt);
	if ( cnt == 0 )
		delete this;
	return cnt;
}

long		MXSTDMETHOD ImageComputePluginLib::DuplicatePtr(void)
{
	return InterlockedIncrement(&_refCnt);
}

void *		MXSTDMETHOD ImageComputePluginLib::Dynamic_cast(const GUID IId)
{
	void *rc = nullptr;

	if ( MxGUID::IsEqual(IId, IMxPluginBaseIID::Guid()))
		rc = static_cast<IMxPluginBase *>(this);
	else
		rc = nullptr;

	std::string tmp;
	if (rc == nullptr)
		MX_SETERROR(MX11115, MxError::Install, MxError::Abort, MxError::QuietReport, "Dynamic_cast does not support IID=%s", MxGUID::ConvertToString(IId, &tmp));
	else
		((IMxPluginBase *)rc)->DuplicatePtr();

	return rc;
}


